<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>   
	<h2>게시판</h2>
	<h4>총 게시물 수 : </h4>
	<table border="1" cellspacing="0" width="100%" class="bbs">
	<thead>
		<tr>
			<th align="center" width="100">번호</th>
			<th>제목</th>
			<th align="center" width="100">날짜</th>
			<th align="center" width="100">조회수</th>
		</tr>
	</thead>
	<tbody>
		<!-- 반복문시작 -->
		<c:set var="sn" value="${pageStartNum}"/>
		<c:forEach var="list" items="${list}"  varStatus="status">
		<!--fmt:parseDate value="${list.reg_date}" pattern="yyyyMMdd" var="date"/-->
		<c:set var="reply" value="0"/>
		<c:set var="replyIcon" value=""/>
		<c:url value="/admin/bbs_view.action" var="toURL">
			<c:param name="bname" value="${list.bname}"/>
			<c:param name="seq" value="${list.seq}"/>
			<c:param name="currentPage" value="${currentPage}"/>
		</c:url> 
		<c:if test="${list.step >0}">
			<c:set var="reply" value="${list.step*5}"/>
			<c:set var="replyIcon" value="<답글>"/>
		</c:if>
		
		<tr>
			<td align="center">${sn - (status.index+1)}</td>
			<td style="padding-left:${reply}px;">
			${replyIcon}
			<a href="${toURL}">${list.title}</ a>
			</td>
			<td align="center">${list.reg_date}</td>
			<td align="center">${list.hit}</td>
		</tr>
		</c:forEach>
		<!-- 반복문끝-->
	</tbody>
	<tfoot>
		<tr>
			<td align="center" colspan="4"> ${pagingHtml}</td>
		</tr>
		<tr>
			<td align="right" colspan="4">
				<input type="button" value="글쓰기" class="button" onclick="location.href='/ssol2/admin/bbs_write_form.action?currentPage=${currentPage}&bname=${bname}'"/>
			</td>
		</tr>
	</tfoot>
	</table>